package com.usian.service.impl;



import com.github.pagehelper.PageInfo;
import com.usian.mapper.DepartmentMapper;
import com.usian.pojo.Department;
import com.usian.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class DepartmentServiceImpl implements DepartmentService {
    @Autowired
    private DepartmentMapper departmentMapper;


    @Override
    public PageInfo<Department> findAll(Integer page, Integer size, Department department) {
        PageInfo<Department> pageInfo = new PageInfo<>(departmentMapper.findAll(department));
        return pageInfo;
    }

    @Override
    public void add(Department department) {
        departmentMapper.insert(department);
    }

    @Override
    public void etid(Department department) {
        departmentMapper.updateById(department);
    }

    @Override
    public void del(Integer id) {
        departmentMapper.deleteById(id);
    }

}
